package com.view.comp
{
	import flash.display.Sprite;
	
	import mx.controls.AdvancedDataGrid;
	
	import org.swizframework.reflection.Constant;
	
	public class ColorAdvancedGrid extends AdvancedDataGrid
	{
		public function ColorAdvancedGrid()
		{
			super();
		}
		public var rowColorFunction:Function;

		protected override function drawRowBackground(s:Sprite, rowIndex:int, y:Number, height:Number, color:uint, dataIndex:int):void{
				if(rowColorFunction != null) 
				{
					var item:Object;
					if(dataIndex < dataProvider.length)
					{
						item = dataProvider[dataIndex];
					}
					
					if(item)
					{
						color = rowColorFunction(item, rowIndex, dataIndex, color);
					}
				}
			super.drawRowBackground(s,rowIndex,y,height,color,dataIndex);                 
		}  
	}
}